<template>
  <div>
    <button @click="add">加</button>
  </div>
</template>

<script>
import { reactive, ref, toRefs } from "vue";
export default {
  name: "",
  props:['d4'],
  // 定义模板
  components: {},
  //在创建组件之前执行
  setup(props, context) {
    console.log(props.d4)
    const state = reactive({
      name: "你好",
    });
    const num = ref(0);
    const add = () => {
      let aa = props.d4
      aa++
      console.log(aa,1111111)
      context.emit('fAdd',aa)
    }
    return {
      ...toRefs(state),
      num,
      add
    };
  },
};
</script>
<style scoped lang ='less'>
</style>